//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing.Diagram
{
    class CTStyleLabel : IOfficeXmlSerializable
    {
        private Colors _txEffectClrLst;
        private Colors _effectClrLst;
        private string _name;
        private Colors _fillClrLst;
        private Colors _linClrLst;
        private Colors _txLinClrLst;
        private Colors _txFillClrLst;
        private OfficeArtExtensionList _extLst;

        public void ReadXml(ReadContext context)
        {
            using (var c = context.Read("styleLbl"))
            {
                _name = c.GetString("name");
                _fillClrLst = c.ReadOptionalElementAs<Colors>("fillClrLst");
                _linClrLst = c.ReadOptionalElementAs<Colors>("linClrLst");
                _effectClrLst = c.ReadOptionalElementAs<Colors>("effectClrLst");
                _txLinClrLst = c.ReadOptionalElementAs<Colors>("txLinClrLst");
                _txFillClrLst = c.ReadOptionalElementAs<Colors>("txFillClrLst");
                _txEffectClrLst = c.ReadOptionalElementAs<Colors>("txEffectClrLst");
                _extLst = c.ReadOptionalElement<OfficeArtExtensionList>("extLst");
            }
        }
        public void WriteXml(WriteContext context)
        {
            using (var c = context.Write("styleLbl"))
            {
                c.SetString("name",_name);
                c.WriteOptionalElementAs(_fillClrLst , "fillClrLst");
                c.WriteOptionalElementAs(_linClrLst, "linClrLst");
                c.WriteOptionalElementAs(_effectClrLst, "effectClrLst");
                c.WriteOptionalElementAs(_txLinClrLst, "txLinClrLst");
                c.WriteOptionalElementAs(_txFillClrLst, "txFillClrLst");
                c.WriteOptionalElementAs(_txEffectClrLst, "txEffectClrLst");
                c.WriteOptionalElement(_extLst);
            }
        }
    }
}